﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Layouts/Monoblock.Master" AutoEventWireup="true" CodeBehind="New.aspx.cs" Inherits="ScrumBox.Web.Views.Sprint.New" %>
<%@ Import Namespace="ScrumBox.Model"%>
<%@ Import Namespace="MvcContrib"%>
  
<asp:Content ID="mainContent" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function() 
        {
          $('#startDate').datepicker();
          $('#endDate').datepicker();
        });
    </script>   
    
    <fieldset>
        <legend>Add new sprint</legend>
        <form method="post" id="new_project" action='<%= Url.Action("save") %>'>
            <% var sprint = ViewData.Get<Sprint>();%>
            
            <label for="title">Title</label>
            <%= Html.TextBox("title", sprint.Title ?? "", new { @class = "required" })%>
            <span class="info">The title of the sprint.</span>
            
            <label for="startDate">Starts</label>        
            <%= Html.TextBox("startDate", sprint.StartDate.HasValue ? sprint.StartDate.Value.ToShortDateString() : "",
                          new { @class = "required" })%>
            <span class="info">The start date of the sprint.</span>                      
                          
            <label for="endDate">Ends</label>        
            <%= Html.TextBox("endDate", sprint.EndDate.HasValue ? sprint.EndDate.Value.ToShortDateString() : "",
                          new { @class = "required" })%>     
            <span class="info">The end date of the sprint.</span>
                                           
            <%= Html.Hidden("projectKey", sprint.Project.Key) %>
            
            <div class="button-row">
                <input type="submit" id="sprint_save" value="Save" class="submit" />
            </span>
        </form>
    </fieldset>
</asp:Content>
